package com.mmall.dao;

import com.mmall.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int checkUserName(String username);

    User getUserByUserNameAndPass(@Param("username") String username, @Param("password") String password);

    int checkEmail(String email);

    String getQuestion(String username);

    int CheckAnswer(@Param("username") String username,@Param("question") String question,@Param("answer") String answer);

    int resetPasswordByID(@Param("userId") Integer userId,@Param("passwordNew")  String passwordNew);
    int resetPasswordByUserName(@Param("username") String username,@Param("passwordNew")  String passwordNew);

    int checkPasswd(@Param("username")Integer userId,@Param("passwd") String passwd);

    String getPassByUsername(String username);

    int checkEmailByUserId(@Param("id") Integer id,@Param("email")  String email);
}
